//
//  HLSyndromeView.m
//  NewKY
//
//  Created by 罗浩林 on 16/11/16.
//  Copyright © 2016年 Dee. All rights reserved.
//

#import "HLSyndromeView.h"

@interface HLSyndromeView ()

@property (weak, nonatomic) IBOutlet UILabel *syndromeLabel;


@end

@implementation HLSyndromeView


-(void)setSyndromeArr:(NSArray *)syndromeArr{
    
    NSMutableString * newStr = [NSMutableString string];
    
    
    [syndromeArr enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        
        if (idx !=syndromeArr.count -1) {
            NSString *str1 = [NSString stringWithFormat:@"%@,",obj];
            
            [newStr appendString:str1];
        }
        
        if (idx == syndromeArr.count -1) {
            [newStr appendString:obj];
        }

    }];
    
    NSString * newnewStr = [NSString stringWithFormat:@"%@(共%zd条)",newStr,syndromeArr.count];
    
    NSLog(@"%@",newStr);
    
    if ([newStr isEqualToString:@""]) {
        
        return;
    }
    
    self.syndromeLabel.text = newnewStr;
    self.syndromeLabel.textColor = [UIColor blackColor];
    
}


@end
